<template>
    <mu-text-field
            v-model="inSideValue"
            :multi-line="config.multiLine"
            :max-length="config.maxLength"
            :rows="config.rows"
            :type="config.editType"
    ></mu-text-field>
</template>

<script>
    export default {
        props: {
            value: {},
            config: {}
        },
        name: "EzText",
        data() {
            return {
                inSideValue: "",
            }
        },
        mounted() {
            this.inSideValue = this.value
        },
        watch: {
            inSideValue(val) {
                if (this.config.editType === 'number'){
                    this.$emit("input", val*1)
                }else{
                    this.$emit("input", val)
                }

            }
        },
    }
</script>

<style scoped>

</style>